<?php include "../../coresection/connection.php";?>
<?php include "../../coresection/checkSession.php";?>
<?php include "../../coresection/order-list.php";?>
<?php include "../../coresection/edit-show.php";?>

<?php include "../../coresection/get_dishes_list.php";?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include '../../modules/head.php'; ?>
</head>

<body>
<?php include '../../modules/topbar.php'; ?>

<div class="setup_area">
    <?include '../../modules/sidebar-admin.php'?>

    <div class="header">
        <h1>菜式修改</h1>
        <?php include '../../modules/header.php'; ?>
    </div>


    <div class="content_area product-edit-box">

<div class="content">
    1.菜式库的选择制作方便输入使用，修改菜式的情况下，并未强制限定与菜式库设置一样。
</div>
        <div class="admin_left_area">
            <?include '../../model/slidebar.php'?>
        </div>


        <div class="main">




        <form action="../../front/m2/coresection/admin-productedit.php" method="post" enctype="multipart/form-data">
            <ul class="admin_set_table">
                <li><label>菜式名：</label><input type="text" id=product_name name="product_name" value="<?echo $product_name?>"/></li>
                <li><label>单价：</label><input type="text" name="product_price" id="product_price" value="<?echo $product_price?>" /></li>

                <li><label></label>

                    <select name="product_month" class="product_week">

                        <option value="<? echo $product_month ?>"> <? echo $product_month ?>月</option>

                        <? for($i=1;$i<=12;$i++){?>
                            <option value="<? echo $i ?>"> <? echo $i ?>月</option>
                        <? } ?>

                    </select>





                    <select name="product_week" class="product_week">

                        <option value="<? echo $product_week ?>"> <? echo $product_week ?>日</option>


                        <? for($i=1;$i<=31;$i++){?>

                            <option value="<? echo $i ?>"><? echo $i ?>号</option>

                        <? } ?>

                    </select>
                    
                    
                    <select name="product_at" class="product_at">
                        <option value="1" <? if($product_at==1){echo "selected='selected'";} ?> >早餐</option>
                        <option value="2" <? if($product_at==2){echo "selected='selected'";} ?> >午餐</option>
                        <option value="3" <? if($product_at==3){echo "selected='selected'";} ?> >晚餐</option>
                    </select>
					
                    
					
                </li>



                <?
                if($_SESSION['quanxian']!="chufang"){?>
                <li><label>发布状态:</label>
                    <select name="status">
                        <option value="<?echo $product_status?>" ><?echo $product_status?></option>
                        <option value="发布"  >发布</option>
                        <option value="待审核"  >待审核</option>
                    </select>
                    </li>
                <? }else {?>
                    <input type="hidden" name="status"  value="<?echo $product_status?>" />
                <?}?>




                <input type="hidden" name="product_id" value="<?echo $product_id?>"/>



            </ul>


            <div style="margin-top:5px; ">
                <input type="submit" class="layui-btn" value="修改""/>
            </div>




            <style>
                .dishes-list{ list-style: none; overflow: hidden;margin-top: 25px;padding-top: 25px; border-top:dashed 1px #232323}
                .dishes-list li{ text-align:left;float: left;min-width: 320px; margin-bottom: 10px;}
            </style>

            <ul class="dishes-list">
                <?
                {$dishes=get_dishes_list($product_at);}
                ?>
                <?for($i=0;$i<count($dishes['name']);$i++)
                {
                    ?>

                    <li>
                        <input type="radio"name='dishes-name-option' value="<? echo $dishes['nid'][$i]?>" onclick="setvalue('<? echo $dishes['name'][$i]?>','<? echo $dishes['price'][$i]?>')"/>
                        <? echo $dishes['name'][$i]?> /
    <span style="font-size: 12px;"  >
        <? echo $dishes['price'][$i]?>
    </span>
                    </li>

                    <?
                }
                ?>


                <script type="text/javascript">
                    function setvalue(name,price){
                        document.getElementById("product_name").value=name;
                        document.getElementById("product_price").value=price;
                    }
                </script>



            </ul>






        </form>
    </div>
</div>

    <?php include 'modules/footer.php'; ?>
</body>
</html>
